package org.spbsu.apco.common.task.core;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import java.util.List;

/**
* User: mikpan
* Date: 1/21/13
* Time: 7:58 PM
*/
public class TaskDescriptor implements InitializingBean {
    private BaseTask baseTask;
    private List input;

    public void setTaskDescriptor(BaseTask baseTask) {
        this.baseTask = baseTask;
    }

    public void setInput(List input) {
        this.input = input;
    }

    public BaseTask getBaseTask() {
        return baseTask;
    }

    public List getInput() {
        return input;
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        Assert.notNull(baseTask, "Base task is not set for a taskDescriptor (type=" + getClass() + "). Check configuration file.");
        Assert.notNull(input, "Input is not set for a taskDescriptor (type=" + getClass() + "). Check configuration file.");
    }
}
